home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / FILER / PARTITION.ZIP / !Partition / ShellData < prev    next >
Text File  |  1997-04-27  |  4KB  |  177 lines

  1. Partition
  2. iconbar
  3. ***
  4. 1
  5. 0
  6. 6
  7. Shortcut to disk partition
  8. © SPROW 1997
  9. 1.15 (27-Apr-1997)
  10. 1
  11. ***
  12. ***
  13. ***
  14. ***
  15. ***
  16. ***
  17.  
  18. iconmenu%
  19. Partition
  20. ...Info    !
  21. ...Setup...&open_setup_box
  22. ¤
  23. @
  24.  
  25. click_buttons
  26. window%,icon%,button%
  27. 10
  28.   :
  29.   path$(csbutton%)=READICON(setup,pathbox%)
  30.   name$(csbutton%)=READICON(setup,namebox%)
  31.   :
  32.   IFicon%=0 ORicon%=1 ORicon%=2 ORicon%=3 THEN
  33.     SETICON(setup,pathbox%,path$(icon%))
  34.     SETICON(setup,namebox%,name$(icon%))
  35.     csbutton%=icon%
  36.   ENDIF
  37.   :
  38.   IFicon%=savebutton% THEN
  39.     IFFNfindvalid=-1 THEN
  40.       PROCaltericon(Grey)
  41.       PROCerror("The partitions you have created have no paths associated with them")
  42.     ELSE
  43.       PROCaltericon(Yellow)
  44.       F=OPENOUT"<ObeyTask$Dir>.Setup"
  45.       FORx%=0TO3:PRINT#F,path$(x%):PRINT#F,name$(x%):NEXT
  46.       CLOSE#F:CLOSEWINDOW(setup)
  47.       partition%=csbutton%
  48.     ENDIF
  49.   ENDIF
  50.   SETICON(-2,iconh%,name$(csbutton%))
  51. ENDPROC
  52. ¤
  53.  
  54. define_variables
  55. ***
  56. 1
  57.    REM Make an array for the 4 supported drives
  58.    DIMpath$(3):DIMname$(3)
  59.    REM Some buttons and stuff
  60.    namebox%=10:pathbox%=12:savebutton%=13:ignorebutton%=4:setupbutton%=1
  61.    csbutton%=0:REM Tag of the currently selected button if "Setup" is open
  62.    partition%=0:REM Tag of the currently selected partition #
  63.    REM Save some memory for error buffers and call blocks
  64.    DIM wimperror% 256
  65.    DIM block% 16
  66.    REM And some icon names
  67.    Grey=0:Yellow=1
  68.    :
  69.    REM Put something in each array element at least
  70.    FORx%=0TO3:path$(x%)="ADFS::":name$(x%)=CHR$(67+x%)+":":NEXT
  71.    :
  72.    F=OPENIN"<ObeyTask$Dir>.Setup"
  73.    IFF<>0 THEN
  74.      LOCAL ERROR
  75.      ONERRORLOCALRESTOREERROR:PROCaltericon(Grey):PROCerror("The 'Setup' file for this application has been damaged"):name$(x%)="Broken":path$(x%)="Broken":PROCopen_setup_box:SETICON(-2,iconh%,name$(partition%)):ENDPROC
  76.      FORx%=0TO3:INPUT#F,path$(x%):INPUT#F,name$(x%):NEXT:CLOSE#F
  77.    ENDIF
  78.    :
  79.    IFFNfindvalid=-1 THEN   
  80.      PROCaltericon(Grey)
  81.      PROCerror("No settings have been made yet for 'Partition' so it cannot be used")
  82.      SETICON(-2,iconh%,name$(partition%))
  83.      PROCopen_setup_box
  84.    ELSE
  85.      partition%=FNfindvalid
  86.      SETICON(-2,iconh%,name$(partition%))
  87.    ENDIF
  88. ENDPROC
  89. ¤
  90.  
  91. open_the_partition
  92. button%
  93. 4
  94.    IFbutton%=4 THEN
  95.     IFpath$(partition%)<>"ADFS::" THEN
  96.       OSCLI"Filer_OpenDir "+path$(partition%) 
  97.     ELSE
  98.       IFFNfindvalid=-1 THEN
  99.         PROCaltericon(Grey)
  100.         PROCerror("No settings have been made yet for 'Partition' so it cannot be used")
  101.       ELSE
  102.         partition%=FNfindvalid
  103.         SETICON(-2,iconh%,name$(partition%))
  104.         OSCLI"Filer_OpenDir "+path$(partition%)
  105.       ENDIF
  106.     ENDIF
  107.    ENDIF 
  108.    IFbutton%=1 THEN
  109.     old%=partition%
  110.     REPEAT
  111.     partition%=partition%+1
  112.     IFpartition%>3 THENpartition%=0
  113.     UNTILpath$(partition%)<>"ADFS::" ORpartition%=old%
  114.    SETICON(-2,iconh%,name$(partition%))
  115.    ENDIF
  116. ENDPROC
  117. ¤
  118.  
  119. open_setup_box
  120. ***
  121. 0
  122.   OPENWINDOW(setup)
  123.   SETICON(setup,namebox%,name$(csbutton%))
  124.   SETICON(setup,pathbox%,path$(csbutton%))
  125. ENDPROC
  126. ¤
  127.  
  128. drop_image
  129. file$,type%
  130. 5
  131.    IFOPENQ(setup)=FALSE THENENDPROC
  132.    SETICON(setup,pathbox%,file$)
  133.    path$(csbutton%)=file$
  134. ENDPROC
  135. ¤
  136.  
  137. error
  138. mssg$
  139. 0
  140.    CLOSE#0
  141.    SYS "Hourglass_Smash"
  142.    title$="Message from Partition"
  143.    button$="Understood"
  144.    flags%=256+2048+8+16
  145.    P%=wimperror%
  146.    [OPT2:EQUD0:EQUSmssg$+CHR$0:]
  147.    SYS "Wimp_ReportError",wimperror%,flags%,title$,,,button$
  148. ENDPROC
  149. ¤
  150.  
  151. FNfindvalid
  152. ***
  153. 0
  154.    LOCAL partition%,found%
  155.    found%=-1
  156.    FORpartition%=0TO3
  157.    IFpath$(partition%)<>"ADFS::" ANDpath$(partition%)<>"" THENfound%=partition%
  158.    NEXT
  159. =found%
  160. ¤
  161.  
  162. altericon
  163. state%
  164. 0
  165.    OSCLI"IconSprites <Obey$Dir>.icon"+STR$(state%)
  166.    REM This block describes 'no change' to iconh%
  167.    !(block%+0)=-2
  168.    !(block%+4)=iconh%
  169.    !(block%+8)=0
  170.    !(block%+12)=0
  171.    REM Make call now,a side effect of which is that the sprite is refreshed
  172.    SYS"Wimp_SetIconState",,block%
  173. ENDPROC
  174. ¤
  175. @
  176.  
  177.